/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package manager;

import entity.OrdersDetails;
import iface.IManagerDisabled;
import java.util.ArrayList;

/**
 *
 * @author Noi
 */
public class DisabledOrdersDetailsManager implements IManagerDisabled<OrdersDetails> {

    private ArrayList<OrdersDetails> alOrdersDetails;
    private Manager manager;
    
    public DisabledOrdersDetailsManager(Manager manager) {
        this.manager = manager;
        this.alOrdersDetails = new ArrayList<OrdersDetails>();
    }
    
    @Override
    public void add(OrdersDetails obj) {
        this.alOrdersDetails.add(obj);
    }

    @Override
    public void recovery(int index) {
        OrdersDetails details = (OrdersDetails)this.alOrdersDetails.remove(index);
        details.setStatus(true);
        this.manager.getOrdersDetailsManager().add(details);
    }

    @Override
    public OrdersDetails get(int index) {
        return this.alOrdersDetails.get(index);
    }
    
}
